package com.mall.common.constant;

import java.util.concurrent.TimeUnit;

/**
 * @author: 谢君臣
 * @Date: 2022/8/10-16:22
 * @version: 1.0
 * @function:
 */
public class PaymentConstant {

    public static final String PAYMENT_TOKEN_PREFIX="mall:order:";
    public static final String PAYMENT_PAY_PREFIX="mall.pay:";
    // 订单支付时间
    public static final String PAYMENT_TIMEOUT_LENGTH = "5m";

    // 订单状态【0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单】
    public enum StatusEnum{
        WAIT_FOR_PAY(0,"待付款"),
        WAIT_FOR_CONSIGNMENT(1,"待发货"),
        ORDER_CONSIGNMENT(2,"已发货"),
        ORDER_FINISH(3,"已完成"),
        ORDER_CLOSED(4,"已关闭"),
        ORDER_INVALID(5,"无效订单");

        private int type;
        private String desc;

        StatusEnum(int type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }
}
